<%@ page  contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ page import="limousine.util.*" %>
<script language="JavaScript" type="text/JavaScript" src="app/js/wz_tooltip.js"></script>

<div class="data_form">
    <div class="head_data_form">
    </div>
    <div class="show_form">
        <table width="100%" cellspacing="10" cellpadding="0">
            <tr>
                <td align="right">
                    <form id="form1" name="form1" method="post" action="">                        
                        <input type="button" name="button" id="button" value="Add Data" onclick="javascript:goUrl('systemsinsertinit.do');" />
                    </form>
                </td>
            </tr>
        </table>

        <table width="100%" border="0" cellspacing="10" cellpadding="0">
            <tr>
                <td><strong>Systems Maneger</strong></td>
            </tr>
            <tr>
                <td>
                    <fieldset>
                        <legend>
                            <strong>search condition</strong></legend>
                        <table width="100%" border="0" cellspacing="5" cellpadding="0">
                            <tr>
                                <td align="center">
                                    <table class="tableForm">
                                        <tr><td valign="center">
                                                <jsp:include page="sys_msg.jsp" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr><td align="center">
                                    <h:form action="/systemsmanagerquery">
                                        <table class="tableForm">
                                            <tr><td class="textFormLabel" align="right" width="30%">Name:</td>
                                                <td align="left"><h:text property="name" styleClass="textBox" size="25"/>
                                                </td>
                                            </tr>
                                            <tr><td class="textFormLabel" align="right">Detail:</td>
                                                <td align="left"><h:textarea property="detail" styleClass="textBox" cols="20" rows="2"/>
                                                </td>
                                            </tr>
                                            <tr><td class="textFormLabel" align="right">Enable:</td>
                                                <td align="left">
                                                    <h:select property="enable" styleClass="comboEnable">
                                                        <h:option value="y">Yes</h:option>
                                                        <h:option value="n">No</h:option>
                                                    </h:select>
                                                </td>
                                            </tr>
                                            <tr height="5"><td class="text" align="center" colspan="2">
                                                </td>
                                            </tr>
                                            <tr><td class="text" align="center" colspan="2">
                                                    <input type="submit" value="Search" class="button" disabled/>&nbsp;
                                                    <input type="reset" value="Clear" class="button"/>
                                                </td>
                                            </tr>
                                        </table>
                                    </h:form>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>
        </table>

        <!-- Make page -->
        <logic:present name="<%=Token.SYSTEMS_PAGE%>">
            <table class="table" width="80%" align="center">
                <tr><td class="text" align="left" colspan="16">
                        <% String offset = (String) session.getAttribute(Token.SYSTEMS_CURRENT_OFFSET);
                                    int pageCount = 1;
                        %>
                        <logic:iterate id="pits" scope="session"
                        type="limousine.util.PageIterator" name="<%=Token.SYSTEMS_PAGE%>">
                            <%if (offset.equals(pits.getNumber())) {%>
                            [<font color="black"><b><%=pageCount%></b></font>]&nbsp;
                            <%} else {%>
                            <a style="color: #FFFFFF" href="javascript:void(0);" id="<%=pits.getNumber()%>" onClick="javascript:goLink('<%=pits.getLink()%>?offset=<%=pits.getNumber()%>','<%=pits.getNumber()%>');">
                                <font color="red"><b><%=pageCount%></b></font></a>&nbsp;
                                <%}%>
                                <% pageCount++;%>
                            </logic:iterate>
                    </td>
                </tr>
            </table>
        </logic:present>
        <!-- Make page -->

        <!-- record -->
        <logic:present name="<%=Token.SYSTEMS%>">
            <table width="100%" border="0" cellspacing="0" cellpadding="10">
                <tr>
                    <td>
                        <fieldset class="bold-th">
                            <legend><strong>search result</strong></legend>
                            <table width="100%" cellspacing="1" cellpadding="1" border="0">
                                <tbody><tr valign="top" align="center">
                                        <th bgcolor="#9a9a9a">No.</th>
                                        <th bgcolor="#9a9a9a">System Name</th>
                                        <th bgcolor="#9a9a9a">Detail</th>
                                        <th bgcolor="#9a9a9a">Enable</th>
                                        <th bgcolor="#9a9a9a">Edit</th>
                                        <th bgcolor="#9a9a9a">Del</th>
                                    </tr>
                                    <%int countRow = 1;%>
                                    <logic:iterate id="bean" scope="session" type="limousine.vo.Systems" name="<%=Token.SYSTEMS%>">
                                        <tr bgcolor="#f0f0f0" onmouseout="this.bgColor='#F0F0F0'" onmouseover="this.bgColor='#CCCC99'">
                                            <td align="center" width="10%" ><%=countRow%></td>
                                            <td  width="25%" ><bean:write name="bean" property="name" /></td>
                                            <td   ><bean:write name="bean" property="detail" /></td>
                                            <td align="center" width="3%" ><%=(bean.getEnable().equals("1")) ? "<img src='app/images/online.png'/>" : "<img src='images/offline.png'/>"%></td>
                                            <td align="center" width="3%" ><a  href="systemseditinit.do?eid=<%=bean.getId()%>" id="E<%=bean.getId()%>" >
                                                    <img src="app/images/edit.gif" border="0" alt="E<%=bean.getId()%>"/>
                                                </a></td>                                            
                                            <td align="center" width="3%" ><a href="#" id="D<%=bean.getId()%>" onclick="javascript:goDelete('systemsmanagerdelete.do?did=<%=bean.getId()%>','D<%=bean.getId()%>','Confirm remove [<%=bean.getName()%>]');" >
                                                    <img src="app/images/delete.gif" border="0" alt="D<%=bean.getId()%>"/>
                                                </a></td>
                                        </tr>
                                        <%countRow++;%>
                                    </logic:iterate>
                                </tbody>
                            </table>
                        </fieldset>
                    </td>
                </tr>
            </table>
        </logic:present>
        <!-- record -->

    </div>
    <div class="bottom_data_form">
    </div>
</div>

